home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1995 May / PC Direct CD-ROM (May 1995).ISO / ipe / nt51e / disk1 / initool.txt < prev    next >
Encoding:
Text File  |  1994-10-26  |  11.9 KB  |  413 lines

  1. IniTool Version 2.42
  2. --------------------
  3.  
  4. Copyright 1994 by McAfee, Inc. Copyright 1993-1994 by Computer Tyme,
  5. Inc. Licensed to McAfee, Inc. from Computer Tyme, Inc.
  6.  
  7. IniTool, a Windows *.INI file manipulator, assists network 
  8. administrators in performing system-wide changes to users' INI 
  9. files. With IniTool, an administrator can change, add and delete 
  10. items from INI files. IniTool is a DOS command-line program that an 
  11. administrator can easily add to a DCL or login script.
  12.  
  13. Running IniTool
  14. ---------------
  15. Syntax:  INITOOL ControlFile IniFile
  16.         or
  17.      INITOOL IniFile
  18.  
  19. IniTool modifies the IniFile by performing the changes indicated in 
  20. ControlFile. If IniFile does not exist, IniTool creates the file 
  21. according to the commands in the ControlFile. The default extension 
  22. for ControlFile and IniFile is .INI. If you use only one parameter, 
  23. IniTool assumes ControlFile is the same name as IniFile except 
  24. ControlFile's extension is .CTL.
  25.  
  26. Example 1:  INITOOL change.ctl system.ini
  27.  
  28. In Example 1, CHANGE.CTL is the control file and SYSTEM.INI is the 
  29. INI file.
  30.  
  31. Example 2:  INITOOL system.ini
  32.  
  33. In Example 2, SYSTEM.CTL is the control file and SYSTEM.INI is the 
  34. INI file.
  35.  
  36. Creating a Control File
  37. -----------------------
  38. The control file's format is similar to an INI file, but it also 
  39. contains IniTool commands. You can use these commands to easily 
  40. modify an INI file. The commands are as follows:
  41.  
  42. ADD               DUPLICATES
  43. ADDITEM           FIRST
  44. ADDVALUE          IF...ELSE...ENDIF
  45. AFTER             LOG
  46. BEFORE            NOBACKUP
  47. CHANGE            SUBST
  48. DEL               TESTMODE
  49. DELITEM           YAK
  50.  
  51. For a description of each command, see "Commands". For more 
  52. information about the IF command, see "Conditionals".
  53.  
  54. A semicolon at the beginning of a line represents a comment. IniTool 
  55. does not process a commented line.
  56.  
  57. To easily add or change lines in an INI file, you can list lines in 
  58. the control file without the ADD or CHANGE command. If you want to 
  59. modify a line if it does exist and add the line if it does not, do 
  60. not use the ADD or CHANGE command.
  61.  
  62. For example:
  63. [386Enh]
  64. ADD Test=3
  65. CHANGE mydevice=mydriver.386
  66. Paging=1
  67.  
  68. If the [386Enh] section does not exist, IniTool creates the section 
  69. when it adds an item.
  70.  
  71. IniTool adds the Test line if there is no other occurrence of  Test 
  72. in the [386Enh] section. If the [386Enh] section contains Test=2, 
  73. the line remains Test=2.
  74.  
  75. IniTool changes the mydevice line if mydevice exists in the [386Enh] 
  76. section. If the [386Enh] section contains no occurrence of mydevice, 
  77. IniTool does not add the mydevice line.
  78.  
  79. IniTool either adds the Paging line if there is no other occurrence 
  80. or changes the Paging line if Paging exists in the [386Enh] section.
  81.  
  82. Device
  83. ------
  84. IniTool automatically adds the device= line to the [386Enh] section 
  85. unless the exact line already exists.  For example, if the 
  86. device=vshare.386 line exists in the [386Enh] section, IniTool does 
  87. not add an additional device=vshare.386 line to the section.  If the 
  88. device=vshare.386 line does not exist in the [386Enh] section, 
  89. IniTool adds the line to the section. IniTool never changes an 
  90. existing device= line unless you use the CHANGE command.
  91.  
  92. Groups
  93. ------
  94. IniTool can add, change, and delete numbered Group lines in the 
  95. [Groups] section of the PROGMAN.INI. It is not necessary to know the 
  96. Group number to perform these modifications. When adding groups, 
  97. IniTool scans for the lowest unused Group number.
  98.  
  99. For example, if the PROGMAN.INI contains:
  100.  
  101. [Groups]
  102. Group1=H:\WINDOWS\MAIN.GRP
  103. Group2=H:\WINDOWS\ACCESSOR.GRP
  104. Group4=H:\WINDOWS\STARTUP.GRP
  105. Group5=H:\WINDOWS\BP7.GRP
  106. Group6=H:\WINDOWS\ALDUS.GRP
  107. Group7=F:\HOME\JOHN\WINDOWS\WORDFORW.GRP
  108. Group8=F:\HOME\JOHN\WINDOWS\MICROSOF.GRP
  109. Group3=F:\HOME\JOHN\WINDOWS\EDOS.GRP
  110.  
  111. And your control file contains:
  112.  
  113. [Groups]
  114. DEL Group=BP7.GRP
  115. Group=MAIN.GRP
  116. Group=MYGROUP.GRP
  117. DEL Group=EDOS.GRP
  118. Group=Z:\SYSTEM\TEST.GRP
  119. Group=MASTER.GRP
  120.  
  121. After executing IniTool, your PROGMAN.INI contains:
  122.  
  123. [Groups]
  124. Group1=MAIN.GRP
  125. Group2=H:\WINDOWS\ACCESSOR.GRP
  126. Group4=H:\WINDOWS\STARTUP.GRP
  127. Group6=H:\WINDOWS\ALDUS.GRP
  128. Group7=F:\HOME\JOHN\WINDOWS\WORDFORW.GRP
  129. Group8=F:\HOME\JOHN\WINDOWS\MICROSOF.GRP
  130. Group5=MYGROUP.GRP
  131. Group3=Z:\SYSTEM\TEST.GRP
  132. Group9=MASTER.GRP
  133.  
  134. Commands
  135. --------
  136. ADD
  137. Syntax: ADD keyword=value
  138. Adds the line if the line does not exist in the section. If the line 
  139. does exist in the section, it remains unchanged.
  140.  
  141. ADDITEM
  142. Syntax: ADDITEM keyword=item to add
  143. Adds an item to the end of an existing line. If the line does not 
  144. exist in the section, IniTool adds the line. For example, you can 
  145. change "Run=Prog1" to "Run=Prog1 Prog2" using ADDITEM Run=Prog2.
  146.  
  147. ADDVALUE
  148. Syntax: ADDVALUE keyword=value to add
  149. Adds a positive value to or subtracts a negative value from an 
  150. existing line. For example, you can change "NumValue=9" to 
  151. "NumValue=12" using ADDVALUE NumValue=3.
  152.  
  153. AFTER
  154. Syntax: AFTER keyword
  155.     Command keyword=value
  156. Moves the next added or changed line after the line specified in 
  157. AFTER.
  158.  
  159. BEFORE
  160. Syntax: BEFORE keyword
  161.     Command keyword=value
  162. Moves the next added or changed line before the line specified in 
  163. BEFORE.
  164.  
  165. CHANGE
  166. Syntax: CHANGE keyword=new value
  167. Changes the line if it exists in the section. If the line does not 
  168. exist, it is not added.
  169.  
  170. DEL
  171. Syntax: DEL keyword
  172.       or
  173.     DEL [section]
  174. Deletes the line or entire section if it exists. For example, you 
  175. can delete the entire [Desktop] section using DEL [Desktop].
  176.  
  177. DELITEM
  178. Syntax: DELITEM parameter=item to delete
  179. Deletes an item from an existing line. For example, you can change 
  180. "Run=Prog1 Prog2" to "Run=Prog2" using DELITEM Run=Prog1.
  181.  
  182. DUPLICATES
  183. Syntax: DUPLICATES keyword=[section]
  184.           or
  185.     DUPLICATES keyword=[*]
  186. Allows you to use duplicate keywords in a section or INI file (use 
  187. the asterisk * to represent the entire file).  Specify the 
  188. duplicates at the beginning of the control file.  IniTool 
  189. automatically sets the device= line as a duplicate in the [386Enh] 
  190. section.
  191.  
  192. FIRST
  193. Syntax: FIRST
  194.     Command keyword=value
  195. Moves the next added or changed line to the beginning of the 
  196. section.
  197.  
  198. IF...ELSE...ENDIF
  199. Syntax: IF condition
  200.          command
  201.     ELSE
  202.          command
  203.     ENDIF
  204. Performs the IF command, if the condition is true; otherwise, 
  205. IniTool performs the ELSE command (when specified). IniTool does not 
  206. require the ELSE command. Use the ENDIF command when listing more 
  207. than one command after ELSE. When using an IF command without an 
  208. ELSE command, use the ENDIF command when listing more than one 
  209. command after IF.  In IniTool, you can place IF commands within IF 
  210. commands (nesting). For examples using the IF...ELSE...ENDIF 
  211. command, refer to "Conditionals".
  212.  
  213. LOG
  214. Syntax: LOG filename
  215. Creates a log of changes made to the INI file. Use this command 
  216. before the first section header. If you do not specify an extension,  
  217. IniTool assumes the extension .LOG.
  218.  
  219. NOBACKUP
  220. Syntax: NOBACKUP
  221. Deletes the backup BNI file immediately after IniTool modifies the 
  222. IniFile.
  223.  
  224. SUBST
  225. Syntax: SUBST 'OldString' 'NewString'
  226. Replaces a string throughout a section or file. Use the SUBST 
  227. command at the beginning of the control file (before any section 
  228. names) to replace a string throughout an INI file. For example, you 
  229. can change "C:\WINDOWS" to "G:\WIN" throughout an INI file using 
  230. SUBST 'C:\WINDOWS' 'G:\WIN' at the beginning of the control file.
  231.  
  232. The SUBST command also supports references to environment variables. 
  233. For example, you can reference the USER variable to access John's 
  234. version of Windows (F:\JOHN\WINDOWS) using F:\%USER%\WINDOWS.
  235.  
  236. TESTMODE
  237. Syntax: TESTMODE
  238. Modifies the BNI file rather than the INI file. Use this command 
  239. before the first section header.
  240.  
  241. YAK
  242. Syntax: YAK
  243. Displays changes on screen. Use this command before the first 
  244. section header.
  245.  
  246. Conditionals
  247. ------------
  248. IniTool supports conditional changes. If the condition is met, 
  249. IniTool performs the specified command(s).
  250.  
  251. IF condition
  252.       command
  253. ELSE
  254.       command
  255. ENDIF
  256.  
  257. AND
  258. Returns the logical AND of two values.
  259. Example:  IF InGroup 'EveryOne' AND InGroup 'Accounting'
  260.  
  261. OR
  262. Returns the logical OR of two values.
  263. Example:  IF InGroup 'EveryOne' OR InGroup 'Accounting'
  264.  
  265. NOT
  266. Returns the logical NOT of a value.
  267. Example:  IF NOT InGroup 'EveryOne'
  268.  
  269. +
  270. Adds two values.
  271. Example:  IF 'A' + 'B' = 'AB'
  272.  
  273. -
  274. Subtracts two values.
  275. Example:  IF 5 - 3 < 4
  276.  
  277. =
  278. Compares two values and returns true if they are equal.
  279. Example:  IF 2 + 2 = 4
  280.  
  281. <>
  282. Compares two values and returns true if they are not equal.
  283. Example:  IF 2 + 2 <> 5
  284.  
  285. >
  286. Compares two values and returns true if the first value is greater 
  287. than the second value.
  288. Example:  IF 'D' > 'C'
  289.  
  290. <
  291. Compares two values and returns true if the first value is less than 
  292. the second value.
  293. Example:  IF 'C' < 'D'
  294.  
  295. >=
  296. Compares two values and returns true if the first value is greater 
  297. than or equal to the second value.
  298. Example:  IF 'D' >= 'C'
  299.  
  300. <=
  301. Compares two values and returns true if the first value is less than 
  302. or equal to the second value.
  303. Example:  IF 'C' <= 'D'
  304.  
  305. ( )
  306. Parentheses begin and end logical groupings for interpretation.
  307. Example:  IF ('A' < 'B') AND (9 > (5 + 3))
  308.  
  309. CPU
  310. Returns the class of the CPU chip.
  311. Example:  IF CPU >= 3
  312.  
  313. DayOfWeek
  314. Returns the first three letters of the day of the week.
  315. Example:  IF DayOfWeek = 'TUE'
  316.  
  317. Display
  318. Returns the type of video card. Types returned are HERC, CGA, EGA, 
  319. VGA.
  320. Example:  IF Display = 'VGA'
  321.  
  322. InGroup 'Group'
  323. Returns true if the user is in the group.
  324. Example:  IF InGroup 'EveryOne'
  325.  
  326. InMem TSR_filename
  327. Returns true if the terminate and stay resident (TSR) program is 
  328. loaded. IniTool requires only the 8 character filename without an 
  329. extension.
  330. Example:  IF InMem SMARTDRV
  331.  
  332. MathChip
  333. Returns true if there is a math coprocessor.
  334. Example:  IF MathChip
  335.  
  336. Month
  337. Returns the first three letters of the Month.
  338. Example:  IF Month = 'AUG'
  339.  
  340. ReadEnv 'Environment String'
  341. Returns the value of an environment variable.
  342. Example:  IF ReadEnv 'ENHANCED' = 'Y'
  343.  
  344. Station
  345. Returns the workstation address on a network.
  346. Example:  IF Station = '250:33333'
  347.  
  348. UpperCase
  349. Returns the UpperCase of a string.
  350. Example:  IF UpperCase ReadEnv 'ENHANCED' = 'Y'
  351.  
  352. UserName
  353. Returns the login name of the user.
  354. Example:  IF UserName = 'John'
  355.  
  356. ValueOf
  357. Returns the value of an element in the current section.
  358. Example:  IF ValueOf 'PagingDrive' <> 'H'
  359.       PagingDrive=C
  360.       ENDIF
  361.  
  362. VLMLoaded
  363. Returns true if the VLM is loaded in the Novell VLM shells. Returns 
  364. false if the VLM is not loaded or it is not a Novell network.
  365. Example:  IF VLMLoaded NETSHLD
  366.  
  367. Backup Files
  368. ------------
  369. When executed, IniTool creates a backup of the original INI file 
  370. with a *.BNI extension. To replace the new INI file with the latest 
  371. BNI file, type:
  372.  
  373. INITOOL restore IniFile
  374.  
  375. This command deletes the current IniFile and renames the BNI file to 
  376. the IniFile.
  377.  
  378. Updating Multiple INI Files
  379. ---------------------------
  380. You can update several INI files by creating a ListFile. A ListFile 
  381. should contain a list of INI files you want to update. To modify 
  382. several INI files, create a ListFile with the following format:
  383.  
  384. directory\IniFile
  385. directory\IniFile
  386.  
  387. To use the ListFile, type:
  388.  
  389. INITOOL ControlFile ListFile
  390.  
  391. You can also pipe a list of files to IniTool. For example,
  392.  
  393. WHEREIS IniFile|INITOOL ControlFile
  394.  
  395. IniDif
  396. ------
  397. IniDif compares two INI files and produces a third file containing 
  398. the differences between the two INI files. You can use IniDif to 
  399. compare a changed INI file to an original INI file after, for 
  400. example, an installation. You can then use the third file as a 
  401. ControlFile to perform modifications on other INI files.
  402.  
  403. Syntax:   INIDIF NewFile OldFile ControlFile
  404.  
  405. Example:  INIDIF system.ini system.old system.ctl
  406.  
  407. In this example, IniDif compares the new SYSTEM.INI file to the old 
  408. SYSTEM.OLD file and lists the differences in the SYSTEM.CTL file.
  409.  
  410.  
  411.  
  412.  
  413.